var mongoose = require('mongoose')
var Schema = mongoose.Schema;
mongoose.connect('mongodb://localhost/test')//连接数据库
var userSchema = new Schema({
    email: {
        type: String,
        required:true
    },
    nickname: {
        type: String,
        required: true,
    },
    password: {
        type: String,
        required:true
    },
    create_time: {
        type: Date,
        //注意 这里不要写Date.now() ，加括号则会立即调用，即此刻确认了，那样直接写死了，不合理
        default:Date.now
    }
})
module.exports=mongoose.model('User',userSchema)